<template>
	<view class="work-container">
		<!-- 轮播图 -->
		<uni-swiper-dot class="uni-swiper-dot-box" :info="data" :current="current" field="content">
			<swiper class="swiper-box" :current="swiperDotIndex" @change="changeSwiper">
				<swiper-item v-for="(item, index) in data" :key="index">
					<view class="swiper-item" @click="clickBannerItem(item)">
						<image :src="item.image" mode="aspectFill" :draggable="false" />
					</view>
				</swiper-item>
			</swiper>
		</uni-swiper-dot>

		<uni-section title="生活记录" type="line"></uni-section>
		<view class="grid-body">
			<uni-grid :column="4" :showBorder="false">
				<uni-grid-item>
					<view class="grid-item-box" @click="handleToVideo">
						<uni-icons type="videocam-filled" size="30"></uni-icons>
						<text class="text">视频</text>
					</view>
				</uni-grid-item>
				<uni-grid-item>
					<view class="grid-item-box" @click="handleToPerson">
						<uni-icons type="contact-filled" size="30"></uni-icons>
						<text class="text">人脉</text>
					</view>
				</uni-grid-item>
				<uni-grid-item>
					<view class="grid-item-box" @click="handleToAsset">
						<uni-icons type="wallet-filled" size="30"></uni-icons>
						<text class="text">资产</text>
					</view>
				</uni-grid-item>
				<uni-grid-item>
					<view class="grid-item-box" @click="handleToPhoto">
						<uni-icons type="image-filled" size="30"></uni-icons>
						<text class="text">照片</text>
					</view>
				</uni-grid-item>
				<uni-grid-item>
					<view class="grid-item-box notOnline" @click="changeGrid">
						<uni-icons type="settings-filled" size="30"></uni-icons>
						<text class="text">距离</text>
					</view>
				</uni-grid-item>
				<uni-grid-item>
					<view class="grid-item-box" @click="handleToCount">
						<uni-icons type="checkbox-filled" size="30"></uni-icons>
						<text class="text">数量</text>
					</view>
				</uni-grid-item>
				<uni-grid-item>
					<view class="grid-item-box" @click="handleToTime">
						<uni-icons type="circle-filled" size="30"></uni-icons>
						<text class="text">时间</text>
					</view>
				</uni-grid-item>
				<uni-grid-item>
					<view class="grid-item-box" @click="handleToDrink">
						<uni-icons type="download-filled" size="30"></uni-icons>
						<text class="text">饮用</text>
					</view>
				</uni-grid-item>
				<!-- <uni-grid-item>
					<view class="grid-item-box" @click="handleToGenealogy">
						<uni-icons type="staff-filled" size="30"></uni-icons>
						<text class="text">族谱</text>
					</view>
				</uni-grid-item> -->
			</uni-grid>
		</view>
		
		<uni-section title="工作记录" type="line"></uni-section>
		<view class="grid-body">
			<uni-grid :column="4" :showBorder="false">
				<uni-grid-item>
					<view class="grid-item-box" @click="handleToTask">
						<uni-icons type="calendar-filled" size="30"></uni-icons>
						<text class="text">任务列表</text>
					</view>
				</uni-grid-item>
				<uni-grid-item>
					<view class="grid-item-box notOnline" @click="changeGrid">
						<uni-icons type="map-filled" size="30"></uni-icons>
						<text class="text">笔记</text>
					</view>
				</uni-grid-item>
				<uni-grid-item>
					<view class="grid-item-box notOnline" @click="changeGrid">
						<uni-icons type="notification-filled" size="30"></uni-icons>
						<text class="text">番茄工作法</text>
					</view>
				</uni-grid-item>
				<uni-grid-item>
					<view class="grid-item-box" @click="handleToPlace">
						<uni-icons type="map-pin-ellipse" size="30"></uni-icons>
						<text class="text">打卡</text>
					</view>
				</uni-grid-item>
			</uni-grid>
		</view>
		<!-- 宫格组件 -->
		<!-- <uni-section title="系统管理" type="line"></uni-section>
		<view class="grid-body">
			<uni-grid :column="4" :showBorder="false">
				<uni-grid-item>
					<view class="grid-item-box notOnline" @click="changeGrid">
						<uni-icons type="heart-filled" size="30"></uni-icons>
						<text class="text">岗位管理</text>
					</view>
				</uni-grid-item>
				<uni-grid-item>
					<view class="grid-item-box notOnline" @click="changeGrid">
						<uni-icons type="gear-filled" size="30"></uni-icons>
						<text class="text">参数设置</text>
					</view>
				</uni-grid-item>
				<uni-grid-item>
					<view class="grid-item-box notOnline" @click="changeGrid">
						<uni-icons type="chat-filled" size="30"></uni-icons>
						<text class="text">通知公告</text>
					</view>
				</uni-grid-item>
				<uni-grid-item>
					<view class="grid-item-box notOnline" @click="changeGrid">
						<uni-icons type="email-filled" size="30"></uni-icons>
						<text class="text">日志管理</text>
					</view>
				</uni-grid-item>
			</uni-grid>
		</view> -->
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				current: 0,
				swiperDotIndex: 0,
				data: [{
						image: '/static/images/banner/banner01.png'
					},
					{
						image: '/static/images/banner/banner02.png'
					},
					{
						image: '/static/images/banner/banner03.png'
					}
				]
			}
		},
		methods: {

			clickBannerItem(item) {
				console.info(item)
			},
			changeSwiper(e) {
				this.current = e.detail.current
			},
			changeGrid(e) {
				return;
				let {
					index
				} = e.detail
				uni.showToast({
					title: `正在建设中...`,
					icon: 'none'
				})
				//this.$modal.showToast('${index}模块建设中~')
			},
			handleToCount(){
				uni.navigateTo({
					url:'/pages/package/work/count/count'
				})
			},
			handleToTime(){
				uni.navigateTo({
					url:'/pages/package/work/time/time'
				})
			},
			handleToPlace(){
				uni.navigateTo({
					url:'/pages/package/work/place/place'
				})
			},
			handleToPhone(){
				uni.navigateTo({
					url:'/pages/package/work/phone/index'
				});
			},
			handleToDrink(){
				uni.navigateTo({
					url:'/pages/package/work/drink/drink'
				});
			},
			handleToGenealogy(){
				uni.navigateTo({
					url:'/pages/genealogy/index'
				});
			},
			handleToPerson(){
				uni.navigateTo({
					url:'/pages/package/work/person/index'
				});
			},
			handleToChat(){
				uni.navigateTo({
					url:'/pages/package/work/chat/index'
				})
			},
			handleToPhoto(){
				uni.navigateTo({
					url:'/pages/package/work/photo/photo'
				})
			},
			handleToVideo(){
				uni.navigateTo({
					url:'/pages/package/work/video/video'
				})
			},
			handleToAsset(){
				uni.navigateTo({
					url:'/pages/package/work/asset/asset'
				})
			},
			handleToTask(){
				uni.navigateTo({
					url:'/pages/package/work/task/index'
				})
			}
		}
	}
</script>

<style lang="scss">
	/* #ifndef APP-NVUE */
	page {
		display: flex;
		flex-direction: column;
		box-sizing: border-box;
		background-color: #fff;
		min-height: 100%;
		height: auto;
	}

	view {
		font-size: 14px;
		line-height: inherit;
	}

	/* #endif */

	.text {
		text-align: center;
		font-size: 26rpx;
		margin-top: 10rpx;
	}

	.grid-item-box {
		flex: 1;
		/* #ifndef APP-NVUE */
		display: flex;
		/* #endif */
		flex-direction: column;
		align-items: center;
		justify-content: center;
		padding: 15px 0;
	}

	.uni-margin-wrap {
		width: 690rpx;
		width: 100%;
		;
	}

	.swiper {
		height: 300rpx;
	}

	.swiper-box {
		height: 150px;
	}

	.swiper-item {
		/* #ifndef APP-NVUE */
		display: flex;
		/* #endif */
		flex-direction: column;
		justify-content: center;
		align-items: center;
		color: #fff;
		height: 300rpx;
		line-height: 300rpx;
	}
	.notOnline{
		color:gray;
		.uni-icons{
			color:gray !important;
		}
	}

	@media screen and (min-width: 500px) {
		.uni-swiper-dot-box {
			width: 400px;
			/* #ifndef APP-NVUE */
			margin: 0 auto;
			/* #endif */
			margin-top: 8px;
		}

		.image {
			width: 100%;
		}
	}
</style>
